package model.houseproject_commity.controller;


import com.github.pagehelper.PageInfo;
import model.houseproject_commity.entity.Commity;
import model.houseproject_commity.entity.Result;
import model.houseproject_commity.service.CommityService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created by ws on 2019/6/25.
 */

@RestController
public class commityController {
@Autowired
    private CommityService commityService;
   @CrossOrigin
    @GetMapping("/subway")
    public Result find(){
        List<Commity> ktypeList = commityService.findAll("");
        Result result=new Result(true,20000,"查询成功",ktypeList);
        return result;
    }
    @CrossOrigin
    @GetMapping("/page/{pageNow}")
    public Result page(@PathVariable("pageNow")Integer pageNow){
        PageInfo<Commity> commityList=commityService.getPageInfo("",pageNow,5);
        Result result=new Result(true,20000,"查询成功",commityList);
        return result;
    }
}
